<?php
/**
 * Boxoffice Administrator products table
 * 
 * @package    	com_pizzapack
 * @subpackage 	components
 * @link 				http://www.digitar.net
 * @license			GNU/GPL
 */
	
	// no direct access
	defined( '_JEXEC' ) or die( 'Restricted access' );
	
	/**
	 * Product Table class
	 *
	 * @package    com_pizzapack
	 * @subpackage components
	 */
	class TableProduct extends JTable
	{
		/** @var int Primary key */
		var $id 							= 0;
		/** @var string */
		var $productName 						= '';
		/** @var string */
		var $productImage						= '';
		/** @var string */
		var $productPrice					= '';
		/** @var string */
		var $type			  		= '';
		/** @var int */
		var $checked_out 			= 0;
		/** @var datetime */
		var $checked_out_time = '';
		/** @var int */
		var $ordering 				= 0;
		/** @var int */
		var $published 				= 0;
		/** @var int */
		var $hits 						= 0;
		/** @var int */
		//var $totalItems 						= 0;
		
		/**
		* @param database A database connector object
		*/
		function __construct( &$db )
		{
			parent::__construct( '#__pizzapack_products', 'id', $db );
		}
	
		/**
		 * Overloaded check function
		 *
		 * @access public
		 * @return boolean
		 * @see JTable::check
		 * @since 1.5
		 */
		function check()
		{
		
			if( !$this->productName )
			{
				$this->setError( JText::_( 'productName missing' ));
				return false;
			}
			if( !$this->productPrice )
			{
				$this->setError( JText::_( 'product Price missing' ));
				return false;
			}			
			
			return true;
		}
	}
